/*
 * ImppCommandEvent.h
 *
 *  Created on: 04.05.2009
 *      Author: h3llfire
 */

#ifndef IMPPCOMMANDEVENT_H_
#define IMPPCOMMANDEVENT_H_

#include <wx/event.h>
#include "../Buddy.h"
#include "../Group.h"

namespace Impp {

class ImppCommandEvent : public wxNotifyEvent{

private:
	wxString moduleName;
	wxString actionName;
	Buddy* buddy;
	Group* group;

public:
	ImppCommandEvent(const wxString & moduleName, const wxString & actionName, wxEventType eventType = wxEVT_NULL, int id = 0);
	virtual ~ImppCommandEvent();

	virtual wxEvent* Clone()const;
	wxString getModuleName();
	wxString getActionName();
	Buddy* getBuddy() const;
	Group* getGroup() const;

	void setBuddy(Buddy* buddy);
	void setGroup(Group* group);

};

typedef void(wxEvtHandler::*ImppCommandEventFunction)(ImppCommandEvent&);

BEGIN_DECLARE_EVENT_TYPES()
  DECLARE_EVENT_TYPE(EVT_IMPP_COMMAND, -1)
END_DECLARE_EVENT_TYPES()

#define EVT_IMPP_COMMAND_MACRO(id, fn) DECLARE_EVENT_TABLE_ENTRY(               \
		EVT_IMPP_COMMAND, id, -1, (wxObjectEventFunction)               \
        (wxEventFunction)(ImppCommandEventFunction) & fn,                             \
        (wxObject*) NULL),

#define ImppCommandEventHandler(func)                                                 \
        (wxObjectEventFunction)                                                \
        (wxEventFunction)wxStaticCastEvent(ImppCommandEventFunction, &func)


}

#endif /* IMPPCOMMANDEVENT_H_ */
